<template>
	<view>
		<view class="search-container" :style="{'background-color': bgcolor}" @click="searchBox">
			<view class="search-box" :style="{'border-radius': radius+'px'}">
				<uni-icons type="search" size="17"></uni-icons>
				<text class="placeholder">搜索</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"search",
		props:{
			//背景颜色
			bgcolor:{
				type:String,
				default:'#c00000'
			},
			//圆角尺寸
			radius:{
				type:Number,
				default:20 //px
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			searchBox(){
				this.$emit('myclick')
			}
		}
	}
</script>

<style lang="scss">
.search-container{
	height: 60px;
	// background-color: #c00000;
	display: flex;
	align-items: center;
	padding: 0 10px;
	.search-box{
		height: 40px;
		width: 100%;
		background-color: #fff;
		// border-radius: 20px;
		display: flex;
		justify-content: center;
		align-items: center;
		.placeholder{
			font-size: 15px;
			margin-left: 5px;
		}
	}
}
</style>
